package com.qf.anno.service;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Service
@Primary
public class UserServiceImpl implements UserService{

    //@PostConstruct  //相当于是xml中的init-method属性（在构造执行后执行）
    public void init(){
        System.out.println("init~~");
    }

    //@PreDestroy //相当于是xml中destroy-method属性（在销毁之前执行）
    public void destroy(){
        System.out.println("destroy~~");
    }
}
